package com.atguigu.spzx.sms.util;

import jakarta.annotation.PostConstruct;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(prefix = "spzx.sms")
@Data
public class SmsProperties {
    String templateId;
    String host;
    String path;
    String method;
    String appcode;

    public static String TEMPLATE_ID;
    public static String HOST;
    public static String PATH;
    public static String METHOD;
    public static String APPCODE;
    //当前类的构造器调用后 由实例对象来调用此方法
    @PostConstruct
    public void init(){
        TEMPLATE_ID = this.templateId;
        HOST = this.host;
        PATH = this.path;
        METHOD = this.method;
        APPCODE = this.appcode;
    }
}
